package com.yloveg.impl;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yloveg.dao.SendMsgMapper;
import com.yloveg.entity.SendMsg;
import com.yloveg.service.SendMsgService;

@Service
public class SendMsgServiceImpl implements SendMsgService {
 
    @Autowired
    private SendMsgMapper sendMsgMapper;

	@Override
	public PageInfo<SendMsg> queryUserMsgPage(int page, int limit, SendMsg record){
	    PageHelper.startPage(page, limit);
	    List<SendMsg> listMsg = this.sendMsgMapper.queryUserMsg(record);
	    PageInfo<SendMsg> resultPage = new PageInfo<SendMsg>(listMsg);
	    return resultPage;
	}

	@Override
	public int insert(SendMsg record) {
		record.setCreateDate(new Date());
		record.setState(1);
		return sendMsgMapper.insert(record);
	}




 
 


}
